﻿<%@ Page Language="C#" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="EditTourService.aspx.cs" Inherits="DLV.BackEnd.Pages.EditTourService" %>

<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI" TagPrefix="asp" %>

<asp:content id="Content1" contentplaceholderid="placeHolderContent" runat="server">
           <div id="toolbar-box">
		<div class="t">
			<div class="t">
				<div class="t"></div>
			</div>
		</div>
		<div class="m">
		    <div id="toolbar" class="toolbar">
			    <table class="toolbar">
			        <tbody>
					    <tr>
						    <td id="toolbar-save" class="button">
						        <asp:LinkButton ID="lbtSave" runat="server" Text="" onclick="lbtSave_Click" CssClass="toolbar">
					                <span id="Span1" title="Save" class="icon-32-save" runat="server"></span>Lưu
					            </asp:LinkButton>
						    </td>
						    <td id="toolbar-cancel" class="button">
						        <asp:LinkButton ID="lbtClose" runat="server" Text="" onclick="lbtClose_Click" 
                                    CssClass="toolbar" CausesValidation="False">
					                <span id="Span2" title="Close" class="icon-32-cancel" runat="server"></span>Thoát
					            </asp:LinkButton>
						    </td>
					    </tr>
				    </tbody>
			    </table>
		    </div>
			<div class="header">Thêm dịch vụ cho tour</div>
			<div class="clr"></div>
		</div>
		<div class="b">
			<div class="b">
				<div class="b"></div>
			</div>
		</div>
	</div>
	<div id="element-box">
		<div class="t">
			<div class="t">
				<div class="t"></div>
			</div>
		</div>
		<div class="m" style="float:left; width:100%">
            <asp:ScriptManager runat="server"></asp:ScriptManager>                                      
			<div class="admin-left">
                 <asp:UpdatePanel runat="server">
                     <ContentTemplate>
                         
                     
                      
			    <p>
                    <asp:RadioButton ID="rdPhuongTien" OnCheckedChanged="Service_CheckedChanged" Text="Phương tiện" GroupName="service" runat="server" AutoPostBack="True"/>
                    <asp:RadioButton ID="rdKhachsan" OnCheckedChanged="Service_CheckedChanged" Text="Khách sạn" GroupName="service" runat="server" AutoPostBack="True"/>
                    <asp:RadioButton ID="rdNhaHang" OnCheckedChanged="Service_CheckedChanged" Text="Nhà hàng" GroupName="service" runat="server" AutoPostBack="True"/>
                    <asp:RadioButton ID="rdDichVu" OnCheckedChanged="Service_CheckedChanged" Text="Dịch vụ" GroupName="service" runat="server" AutoPostBack="True"/>
                    <asp:RadioButton ID="rdHoaHong" OnCheckedChanged="Service_CheckedChanged" Text="Hoa hồng" GroupName="service" runat="server" AutoPostBack="True"/>
                    <asp:RadioButton ID="rdVisa" OnCheckedChanged="Service_CheckedChanged" Text="Visa" GroupName="service" runat="server" AutoPostBack="True"/>
                    <asp:RadioButton ID="rdBaoHiem" OnCheckedChanged="Service_CheckedChanged" Text="Bảo hiểm" GroupName="service" runat="server" AutoPostBack="True"/>
                </p>
                <p id="phuongtien">
                    <asp:RadioButton ID="rdMayBay" Text="Máy bay" OnCheckedChanged="TranSport_CheckedChanged" runat="server" GroupName="phuongtien" AutoPostBack="True"/>
                    <asp:RadioButton ID="rdTauHoa" Text="Tàu Hỏa" OnCheckedChanged="TranSport_CheckedChanged" runat="server" GroupName="phuongtien" AutoPostBack="True"/>
                    <asp:RadioButton ID="rdOto" Text="Ô tô" OnCheckedChanged="TranSport_CheckedChanged" runat="server" GroupName="phuongtien" AutoPostBack="True"/>
                 </p>
                 <table class="adminform">
                    <tr>
						<td colspan="2">
                            <div id="ErorMessage" style="color: Red;line-height: 150%;"></div>
                        </td>
					</tr>
                    <tr>
                        <td style="width:20%;"><asp:Label ID="lbConcernAir" runat="server" Text="Hãng hàng không: "/>
                            <asp:Label ID="lbConcernStation" runat="server" Text="Hãng tàu hỏa: "/>
                            <asp:Label ID="lbConcernCar" runat="server" Text="Nhà cung cấp xe: "/>
                        </td>
                        <td><asp:DropDownList ID="ddlConcern" runat="server" Width="413px"/></td>
                    </tr>
                    <tr>
                        <%--<td><asp:Label ID="lbSchedule" Text="Lịch trình:" runat="server"/></td>
                        <td><asp:DropDownList ID="ddlSchedule" runat="server" Width="413px"/></td>--%>

                        <td><asp:Label Text="Nơi khởi hành" ID="lbBeginLocation" runat="server"/></td>
                        <td><asp:DropDownList ID="ddlBeginLocation" runat="server" Width="400px"></asp:DropDownList></td>
                    </tr>
                    <tr>
                        <td><asp:Label Text="Nơi đến" ID="lbEndLocation" runat="server"/></td>
                        <td><asp:DropDownList ID="ddlEndLocation" runat="server" Width="400px"></asp:DropDownList></td>
                    </tr>

                    <tr>
                        <td><asp:Label ID="lbNational" Text="Quốc gia:" runat="server"/></td>
                        <td><asp:DropDownList ID="ddlNational" runat="server" Width="413px"/></td>
                    </tr>
                     <tr>
                         <td><asp:Label runat="server" Text="Tỉnh/thành phố:" ID="lbCity"/></td>
                        <td><asp:DropDownList ID="ddlCity" runat="server" Width="413px"/></td>
                     </tr>
                     <tr>
                         <td><asp:Label ID="lbHotelType" Text="Loại khách sạn: " runat="server"/>
                            <asp:Label ID="lbTypeCar" runat="server" Text="Hiệu xe: "/>
                            <asp:Label ID="lbRestaurantType" runat="server" Text="Loại nhà hàng: "/>
                            <asp:Label ID="lbVisaType" runat="server" Text="Nhà cung cấp :"/>
                            <asp:Label ID="lbLocation" runat="server" Text="Địa điểm:"/>
                         </td>
                        <td><asp:DropDownList ID="ddlHotelType" runat="server" Width="413px"/>
                            <%--<asp:DropDownList ID="ddlLocation" runat="server" Width="413px" AutoPostBack="True" OnSelectedIndexChanged="Location_SelectedIndexChange"/>--%>
                            <asp:DropDownList ID="ddlLocation" runat="server" Width="413px"/>
                            <asp:DropDownList ID="ddlPartner" runat="server" Width="413px"/>
                    </td>
                     </tr>
                     <tr>
                         <td><asp:Label ID="lbHotel" Text="Khách sạn: " runat="server"/>
                            <asp:Label ID="lbCar" runat="server" Text="Xe: "/>
                            <asp:Label ID="lbRestaurant" runat="server" Text="Nhà hàng: "/>
                            <asp:Label ID="lbService" runat="server" Text="Dịch vụ: "/>
                            <asp:Label ID="lbVisa" runat="server" Text="Visa :"/>
                            <asp:Label ID="lbInsurance" runat="server" Text="Bảo hiểm:"/></td>
                        <td><asp:DropDownList ID="ddlHotel" runat="server" Width="413px"/>
                            <asp:DropDownList ID="ddlRestaurant" runat="server" Width="413px"/>
                            <asp:DropDownList ID="ddlVisa" runat="server" Width="413px"/>
                            <asp:DropDownList ID="ddlInsurance" runat="server" Width="413px"/>
                            
                            <div>
                                <input id="txtServicePopup" runat="server" type="text" onclick="openPopup('viand')" style="width:400px;" readonly="readonly" placeholder="Click để chọn dịch vụ"/>
                            </div>
                            <input type="hidden" id="txtService" runat="server" value=""/>
                        </td>
                     </tr>
                </table>
                </ContentTemplate>
                 </asp:UpdatePanel>
              </div>
            <div class="clr"></div>
		</div>
		<div class="b">
			<div class="b">
				<div class="b"></div>
			</div>
		</div>
	</div>
    
    
     <link href="/css/popup.css" rel="stylesheet" />
    <script src="/js/jquery.popup.js"></script>
    <div class="popup-wrapper"></div>
    <div class="popup-main popup-viand">
        <div class="popup-content">
            <div class="popup-close icon-close" onclick="closePopup('viand')"></div>
            <% foreach (DLV.Data.Entities.ServiceInfo info in ServiceList){ %>
            <div class="item">
                <input type="checkbox" name="ckss" value="<%=info.ServiceId %>">
                <span><%=info.ServiceName %></span>
            </div>
            <%} %> 
        </div>
    </div>  
    
    <script src="/js/jquery.address.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            loadCityByNational('#<%=ddlNational.ClientID%>', '#<%=ddlCity.ClientID%>');
            loadHotelByHotelType('#<%=ddlHotelType.ClientID%>', '#<%=ddlHotel.ClientID%>', '#<%=ddlCity.ClientID%>');
            loadRestaurantByRestaurantType('#<%=ddlHotelType.ClientID%>', '#<%=ddlRestaurant.ClientID%>', '#<%=ddlCity.ClientID%>');
            loadLocationByCity('#<%=ddlCity.ClientID%>', '#<%=ddlLocation.ClientID%>');
            loadVisaByPartner('#<%=ddlPartner.ClientID%>', '#<%=ddlVisa.ClientID%>');
        });
    </script>
     <script type="text/javascript">
         function ShowUtilities() {
             document.getElementById("search").style.display = "block";
         }
         function HideUtilities() {
             document.getElementById("search").style.display = "none";
         }
         $(document).ready(function () {
             //đỗ dữ liệu vào các checkbox (check hay ko check)
             var arrViand = $("#<%=txtService.ClientID %>").val();
             var arr = arrViand.split(",", 100);
             $("input[name='ckss']").each(function () {
                 for (var i = 0; i < arr.length; i++) {
                     var x = $(this).val();
                     if (x == arr[i]) {
                         $(this).attr('checked', true);
                         break;
                     }
                 }
             });
             //xử lý sự kiên check của checkobox
             $("[name='ckss']").change(function () {
                 var str = "";
                 $("input[name='ckss']:checked").each(function (i, val) {
                     if (str == "")
                         str += $(this).val();
                     else
                         str += "," + $(this).val();
                 });

                 $("#<%=txtService.ClientID %>").val(str);
             });
         });
    </script>
</asp:content>


